#ifndef __THREAD_EVENT_H
#define __THREAD_EVENT_H

#include "md_sysmsg.h"
#include "list.h"
#include "common_conf.h"
#include "thread_event.h"


typedef struct	_t_event_listen t_event_listen;
typedef int (*event_callback_func)(t_event_listen *event, void *arg);   
typedef struct	_t_event_listen{

	int event_id;						//事件id
	void *user_data;					//用户参数
	event_callback_func cb;				//注册的回调函数指针
	struct list_head list;	
}t_event_listen;

int event_module_add_init(int num, t_event_listen *event_listen_list);

int event_module_del_deinit(int msqid, t_event_listen *event_listen_list);

int event_listen(t_event_listen *event_listen_list , int event_id, void *user_data, event_callback_func cb);

int event_unlisten(t_event_listen *event_listen_list , int event_id);

int event_listen_process(int msqid, t_event_listen *event_listen_list, int is_block);

int event_msg_send(int msqid,int event_id, void *arg );

#endif
